// eslint-disable-next-line
import { BasicLayout, BlankLayout, PageView } from '@/layouts'
import { bxAnaalyse } from '@/core/icons'

export const asyncRouterMap = [

  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    redirect: '/dashboard/panel',
    children: [
      // dashboard
      {
        path: '/dashboard',
        name: 'dashboard',
        redirect: '/dashboard/panel',
        component: PageView,
        meta: { title: '主页', icon: bxAnaalyse },
        children: [
          {
            path: '/dashboard/panel',
            name: 'panel',
            component: () => import('@/views/dashboard/Panel'),
            meta: { title: '数据面板', permission: [0] }
          }
        ]
      },
      {
        path: '/authority',
        name: 'authority',
        redirect: '/authority/role',
        component: PageView,
        meta: {
          title: '权限管理',
          icon: 'setting'
        },
        children: [
          {
            path: '/authority/role',
            name: 'role',
            component: () => import('@/views/authority/Role'),
            meta: {
              title: '角色管理',
              permission: [3]
            }
          },
          {
            path: '/authority/newRole',
            name: 'newRole',
            hidden: true,
            component: () => import('@/views/authority/NewRole'),
            meta: {
              title: '新增角色',
              permission: [9, 10]
            }
          },
          {
            path: '/authority/user',
            name: 'user',
            component: () => import('@/views/authority/User'),
            meta: {
              title: '用户管理',
              permission: [4]
            }
          }
        ]
      }

      // // account
      // {
      //   path: '/account',
      //   component: PageView,
      //   redirect: '/account/center',
      //   name: 'account',
      //   meta: { title: '个人页', icon: 'user', permission: [ 'user' ] },
      //   children: [
      //     {
      //       path: '/account/center',
      //       name: 'center',
      //       component: () => import('@/views/account/center'),
      //       meta: { title: '个人中心', permission: [ 'user' ] }
      //     },
      //     {
      //       path: '/account/settings',
      //       name: 'settings',
      //       component: () => import('@/views/account/settings/Index'),
      //       meta: { title: '个人设置', hideHeader: true, permission: [ 'user' ] },
      //       redirect: '/account/settings/base',
      //       hideChildrenInMenu: true,
      //       children: [
      //         {
      //           path: '/account/settings/base',
      //           name: 'BaseSettings',
      //           component: () => import('@/views/account/settings/BaseSetting'),
      //           meta: { title: '基本设置', hidden: true, permission: [ 'user' ] }
      //         },
      //         {
      //           path: '/account/settings/security',
      //           name: 'SecuritySettings',
      //           component: () => import('@/views/account/settings/Security'),
      //           meta: { title: '安全设置', hidden: true, permission: [ 'user' ] }
      //         },
      //         {
      //           path: '/account/settings/custom',
      //           name: 'CustomSettings',
      //           component: () => import('@/views/account/settings/Custom'),
      //           meta: { title: '个性化设置', hidden: true, permission: [ 'user' ] }
      //         },
      //         {
      //           path: '/account/settings/binding',
      //           name: 'BindingSettings',
      //           component: () => import('@/views/account/settings/Binding'),
      //           meta: { title: '账户绑定', hidden: true, permission: [ 'user' ] }
      //         },
      //         {
      //           path: '/account/settings/notification',
      //           name: 'NotificationSettings',
      //           component: () => import('@/views/account/settings/Notification'),
      //           meta: { title: '新消息通知', hidden: true, permission: [ 'user' ] }
      //         }
      //       ]
      //     }
      //   ]
      // }
    ]
  },
  {
    path: '*', redirect: '/404', hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }
].concat(asyncRouterMap)
